#include <string>
#include<iostream>
#include <vector>
using namespace std;
int main()
{
	int start, end;
	cin >> start >> end;
	vector<int> temp1;
	for (int i = start; i <= end; i++)
	{
		string temp = to_string(i);
		int num[6];
		for (int a = 0; a < temp.length(); a++)
		{
			temp1.push_back(int(temp[a] - '0')); 
			num[a] = temp1;
		}
		for (int b = 0; b < temp.length(); b++)
		{
			if (i % num[b] != 0)
			{
				break;
			}
			if (b + 1 == temp.length())
			{
				cout << i;
			}
		}
	}
	return 0;
}